<template>
	<div class="hello">
		全局参数{{ global1 }}
		 
		<br />
		=================================
		<br />
		<hybrid-c></hybrid-c>
	</div>
</template>

<script>
import Vue from 'vue';
//	import { hybrid } from './app'

var hybrid = {};
window.Hybrid = hybrid;

import hybridC from './hybridC.vue';
Vue.prototype.$hybrid = hybrid;

export default {
	name: 'hybridp',
	components: { hybridC },
	data() {
		return {		 
			global1: window.a
		};
	},
	created() {
		// 将全局方法绑定到this.login上
		this.$hybrid.cardlogin = this.login;
	},
	methods: {
		// 暴露给安卓的方法
		login(json) {
			this.global1=json
			alert(json);
		}
	}
};
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang='less'>
	.hello{
		color: red; 
	}
 
</style>
